import java.util.concurrent.atomic.AtomicInteger

import akka.actor.{Props, ActorSystem}
import akka.util.Timeout
import scala.io.StdIn
import scala.concurrent.duration._


object DemoClient {
  def main(args : Array[String]) {

    val system = ActorSystem("ClusterTest")
    val t = system.actorOf(Props[Task], name = "task")

    val counter = new AtomicInteger
    import system.dispatcher
    system.scheduler.schedule(2.seconds, 5.seconds) {
      t ! Value(counter.incrementAndGet())
      Thread.sleep(5000)
    }

    StdIn.readLine()
    system.terminate()
  }
}




